{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "98c51ca7-2ff9-41f2-8809-d374081b161f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ab295bfe-5694-4827-8396-6789799b7995",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "cd7149e2-6d93-4e29-bc34-c60c29a719a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2000, 12)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "81d2777b-2fe7-4d0a-a1ee-4fece719521a",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7d07e705-cb99-4c24-918b-6f21c2016c13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5415, 17)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "9ad85e2a-a0be-41fb-8395-0d67833430a9",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c6024a88-80ff-45ec-b998-396cbfc8426e",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "504d8699-40a1-4058-9e34-21115ed15140",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.dataframe.frame.DataFrame"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "0c7d8cc0-6bb9-489d-8c6d-15abc22289c2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.dataframe.frame.DataFrame"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6ad4959d-1ed2-4d1c-815d-718293c6a55d",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1057477.0,\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"上网发行比例\":{\"number_fg_mode\":\"disabled\",\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[[\"market_amount\",\"desc\"]],\"filter\":[],\"expressions\":{\"上网发行比例\":\"\\\"market_amount\\\" / \\\"amount\\\"\",\"price_cent\":\"\\\"price\\\" * 100\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price_cent\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "3046f320-d4b4-4296-ade2-a657c82a4c0f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1057477.0,\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"上网发行比例\":{\"number_fg_mode\":\"disabled\",\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[[\"market_amount\",\"desc\"]],\"filter\":[],\"expressions\":{\"上网发行比例\":\"\"market_amount\" / \"amount\"\",\"price_cent\":\"\"price\" * 100\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price_cent\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "05e54c23-3056-4ae6-ab24-7d9a222abf51",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ca647a65-d32d-42e7-9006-5d854615be93",
   "metadata": {},
   "outputs": [],
   "source": [
    "config2 = Path(\"C:/Users/mate/Downloads/untitled.config.json\").read_text(encoding=\"utf8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "ffdf09ef-42c9-400c-b2f2-ec56ac26ff84",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1057477.0,\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"上网发行比例\":{\"number_fg_mode\":\"disabled\",\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[[\"market_amount\",\"desc\"]],\"filter\":[],\"expressions\":{\"上网发行比例\":\"\\\"market_amount\\\" / \\\"amount\\\"\",\"price_cent\":\"\\\"price\\\" * 100\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price_cent\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "487db6fc-376e-4bcb-9f6d-033ae60a409b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "d0de7ba2-959b-4812-8cec-6c98f48b455b",
   "metadata": {},
   "outputs": [],
   "source": [
    "d = json.loads(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "8335461d-ae1e-4633-97cd-39dce8bcae21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'version': '3.6.0',\n",
       " 'plugin': 'Datagrid',\n",
       " 'plugin_config': {'columns': {},\n",
       "  'edit_mode': 'READ_ONLY',\n",
       "  'scroll_lock': False},\n",
       " 'columns_config': {'name': {'format': 'bold',\n",
       "   'string_color_mode': 'foreground'},\n",
       "  'price': {'number_bg_mode': 'gradient', 'bg_gradient': 557.8},\n",
       "  'market_amount': {'number_format': {'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  'price_cent': {'number_format': {'style': 'currency',\n",
       "    'currency': 'CNY',\n",
       "    'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  'amount': {'number_bg_mode': 'gradient',\n",
       "   'bg_gradient': 1057477.0,\n",
       "   'number_format': {'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  '上网发行比例': {'number_fg_mode': 'disabled',\n",
       "   'number_bg_mode': 'gradient',\n",
       "   'bg_gradient': 1.0,\n",
       "   'number_format': {'style': 'percent',\n",
       "    'minimumFractionDigits': 2.0,\n",
       "    'maximumFractionDigits': 2.0}}},\n",
       " 'settings': True,\n",
       " 'theme': 'Pro Light',\n",
       " 'title': None,\n",
       " 'group_by': [],\n",
       " 'split_by': [],\n",
       " 'sort': [['market_amount', 'desc']],\n",
       " 'filter': [],\n",
       " 'expressions': {'上网发行比例': '\"market_amount\" / \"amount\"',\n",
       "  'price_cent': '\"price\" * 100'},\n",
       " 'columns': ['ts_code',\n",
       "  'sub_code',\n",
       "  'name',\n",
       "  'ipo_date',\n",
       "  'issue_date',\n",
       "  'amount',\n",
       "  'market_amount',\n",
       "  '上网发行比例',\n",
       "  'price_cent',\n",
       "  'price',\n",
       "  'pe',\n",
       "  'limit_amount',\n",
       "  'funds',\n",
       "  'ballot'],\n",
       " 'aggregates': {}}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "f13aa3c1-964b-4aca-9529-99d510992da1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3ee7fa8829ed4d8facee8b4311b184a9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1, )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "838020a2-b7da-48b1-96c7-02fd526bf095",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "6339e518-ca55-4471-8a70-011a4ba897c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "99b0d014b4fc45b28cf0ab588f3755ff",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "5da6b56a-10c9-4cb8-a6bb-736852a2039e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.45</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;001400.SZ&quot;</td><td>&quot;001400&quot;</td><td>&quot;江顺科技&quot;</td><td>2025-04-15</td><td>2025-04-24</td><td>1500.0</td><td>1500.0</td><td>37.36</td><td>15.32</td><td>1.5</td><td>5.604</td><td>0.01</td><td>&quot;001400&quot;</td><td>&quot;N江顺科&quot;</td><td>&quot;江苏&quot;</td><td>&quot;专用机械&quot;</td><td>&quot;江苏江顺精密科技集团股份有限公司&quot;</td><td>&quot;Giansun Precision Technology G…</td><td>&quot;jskj&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2025-04-24</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;301560.SZ&quot;</td><td>&quot;301560&quot;</td><td>&quot;众捷汽车&quot;</td><td>2025-04-15</td><td>2025-04-25</td><td>3040.0</td><td>1216.0</td><td>16.5</td><td>21.3</td><td>0.7</td><td>5.016</td><td>0.02</td><td>&quot;301560&quot;</td><td>&quot;众捷汽车&quot;</td><td>&quot;江苏&quot;</td><td>&quot;汽车配件&quot;</td><td>&quot;苏州众捷汽车零部件股份有限公司&quot;</td><td>&quot;PXI Auto Components (Suzhou) C…</td><td>&quot;zjqc&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2025-04-25</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;603697.SH&quot;</td><td>&quot;732697&quot;</td><td>&quot;有友食品&quot;</td><td>2019-04-23</td><td>2019-05-08</td><td>7950.0</td><td>7155.0</td><td>7.87</td><td>13.92</td><td>3.1</td><td>6.257</td><td>0.05</td><td>&quot;603697&quot;</td><td>&quot;有友食品&quot;</td><td>&quot;重庆&quot;</td><td>&quot;食品&quot;</td><td>&quot;有友食品股份有限公司&quot;</td><td>&quot;Youyou Foods Co.,Ltd.&quot;</td><td>&quot;yysp&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-08</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300772.SZ&quot;</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>2019-04-17</td><td>2019-04-26</td><td>7349.0</td><td>6614.0</td><td>6.52</td><td>22.97</td><td>2.8</td><td>4.792</td><td>0.04</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>&quot;浙江&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;运达能源科技集团股份有限公司&quot;</td><td>&quot;Windey Energy Technology Group…</td><td>&quot;ydgf&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-04-26</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌────────┬────────┬────────┬────────┬───┬───────┬───────┬───────┬───────┐\n",
       "│ ts_cod ┆ sub_co ┆ name   ┆ ipo_da ┆ … ┆ delis ┆ is_hs ┆ act_n ┆ act_e │\n",
       "│ e      ┆ de     ┆ ---    ┆ te     ┆   ┆ t_dat ┆ ---   ┆ ame   ┆ nt_ty │\n",
       "│ ---    ┆ ---    ┆ str    ┆ ---    ┆   ┆ e     ┆ str   ┆ ---   ┆ pe    │\n",
       "│ str    ┆ str    ┆        ┆ date   ┆   ┆ ---   ┆       ┆ str   ┆ ---   │\n",
       "│        ┆        ┆        ┆        ┆   ┆ null  ┆       ┆       ┆ str   │\n",
       "╞════════╪════════╪════════╪════════╪═══╪═══════╪═══════╪═══════╪═══════╡\n",
       "│ 301595 ┆ 301595 ┆ 太力科 ┆ 2025-0 ┆ … ┆ null  ┆ null  ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆ 技     ┆ 5-08   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 688755 ┆ 787755 ┆ 汉邦科 ┆ 2025-0 ┆ … ┆ null  ┆ null  ┆ null  ┆ null  │\n",
       "│ .SH    ┆        ┆ 技     ┆ 5-07   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 301636 ┆ 301636 ┆ 泽润新 ┆ 2025-0 ┆ … ┆ null  ┆ null  ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆ 能     ┆ 4-28   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 001400 ┆ 001400 ┆ 江顺科 ┆ 2025-0 ┆ … ┆ null  ┆ N     ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆ 技     ┆ 4-15   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 301560 ┆ 301560 ┆ 众捷汽 ┆ 2025-0 ┆ … ┆ null  ┆ N     ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆ 车     ┆ 4-15   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ …      ┆ …      ┆ …      ┆ …      ┆ … ┆ …     ┆ …     ┆ …     ┆ …     │\n",
       "│ 600989 ┆ 730989 ┆ 宝丰能 ┆ 2019-0 ┆ … ┆ null  ┆ H     ┆ null  ┆ null  │\n",
       "│ .SH    ┆        ┆ 源     ┆ 4-30   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 300778 ┆ 300778 ┆ 新城市 ┆ 2019-0 ┆ … ┆ null  ┆ N     ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆        ┆ 4-25   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 002953 ┆ 002953 ┆ 日丰股 ┆ 2019-0 ┆ … ┆ null  ┆ N     ┆ 冯就  ┆ 民营  │\n",
       "│ .SZ    ┆        ┆ 份     ┆ 4-24   ┆   ┆       ┆       ┆ 景    ┆ 企业  │\n",
       "│ 603697 ┆ 732697 ┆ 有友食 ┆ 2019-0 ┆ … ┆ null  ┆ N     ┆ null  ┆ null  │\n",
       "│ .SH    ┆        ┆ 品     ┆ 4-23   ┆   ┆       ┆       ┆       ┆       │\n",
       "│ 300772 ┆ 300772 ┆ 运达股 ┆ 2019-0 ┆ … ┆ null  ┆ S     ┆ null  ┆ null  │\n",
       "│ .SZ    ┆        ┆ 份     ┆ 4-17   ┆   ┆       ┆       ┆       ┆       │\n",
       "└────────┴────────┴────────┴────────┴───┴───────┴───────┴───────┴───────┘"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2, on=\"ts_code\", how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "caed326f-bc98-46ff-a7b5-2b730ced5254",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8d779eb09cc64207a9e89b18be822a98",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "a387deac-0f60-46b6-978e-8dc118fb62b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b001eeb516534bd59d9c6b7d43a0bdeb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "56985eb1-e196-4675-885d-e0903b8361ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cc17183eeeb4456ab7e92a67a2a838a1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7932c4b7-9766-43b6-9e79-384eac3366e7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "f8dde8c6-2f5e-488c-a028-e02388013b36",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f9208038bf9141528f0e5c8252b9b7db",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "aec3bd4f-7296-4eaf-8962-4431bc857db9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4a44364edfa4442598983f7974fc2d8b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1e5cef71-b8dc-4fab-9e1f-eeb77199fe12",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "1fbf356c-b886-49a1-ba0c-d8aa307836c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "55a52628323d405aa7beeea9552a2659",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2be8d421-ba45-4f4a-8c57-942b03570126",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "910f1276-453e-4057-b784-41142639d9c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8d1d43e4fdc94790afd17a2098d0fb31",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "48fcd025-68f9-490e-8087-2527e8dc436f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d85a2538-2ad6-4102-8470-a02ec3cd5bd3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eeefd620-f4fa-4e29-9bc1-093f749a927e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "968a588d-feae-4bb2-afe8-f08514910b1f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
